var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = cc._decorator,
    i = a.ccclass,
    s =
        (a.property,
        (function (t) {
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            return (
                n(e, t),
                (e.prototype.onLoad = function () {
                    this.ss = {};
                    for (var t = this.node.getChildByName("ss"), e = 0, o = t.children; e < o.length; e++) {
                        var n = o[e],
                            r = (this.ss[n.name] = {});
                        this._set(n, "", r);
                    }
                    t.destroy(), (this.node.active = !1), (this.enabled = !1);
                }),
                (e.prototype.add = function (t) {
                    for (var e in t) this.ss[e] = t[e];
                }),
                (e.prototype.add2 = function (t) {
                    for (var e in t) {
                        var o = e.match(/^([^\/]+)\/(.+)$/);
                        if (o) {
                            var n = o[1];
                            this.ss[n] || (this.ss[n] = {}), (this.ss[n][o[2]] = t[e]);
                        } else console.error("匹配失败：" + e);
                    }
                }),
                (e.prototype._set = function (t, e, o) {
                    for (var n = 0, r = t.children; n < r.length; n++) {
                        var a = r[n],
                            i = a.getComponent(cc.Sprite),
                            s = e + a.name;
                        i && (o[s] = i.spriteFrame), this._set(a, s + "/", o);
                    }
                }),
                (e.prototype.getUIInfos = function () {
                    for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
                    for (var o, n = {}, r = 0, a = t; r < a.length; r++) {
                        var i = a[r];
                        for (var s in this.ss[i]) {
                            var c = (o = this.ss[i][s]).getRect(),
                                l = o._capInsets,
                                u = [c.x, c.y, c.width, c.height];
                            l &&
                                (l[0] > 0 || l[1] > 0 || l[2] > 0 || l[3] > 0) &&
                                ((u[4] = l[0]), (u[5] = l[1]), (u[6] = l[2]), (u[7] = l[3])),
                                (n[i + "/" + s] = u);
                        }
                    }
                    return {src: o.getTexture().nativeUrl, rects: n};
                }),
                (e = r([i], e))
            );
        })(cc.Component));
o.default = s;
